package tools;
import java.io.*;
import java.util.*;
public class SimpleSpectrum {
	public static double[][] getPeakGroup(String sp_file)throws Exception
	{
		BufferedReader infile=new BufferedReader(new FileReader(sp_file));
		String rline=new String();
		ArrayList<double[]> peak_list=new ArrayList<double[]>();
		infile.readLine();
		while((rline=infile.readLine())!=null)
		{
			String[] splits=rline.split("\\s+");
			double[] peak_pair=new double[2];
			peak_pair[0]=Double.parseDouble(splits[0]);
			peak_pair[1]=Double.parseDouble(splits[1]);
			peak_list.add(peak_pair);
		}
		
		double[][] peak_group=new double[peak_list.size()][2];
		int index=0;
		for(double[] iter_peak:peak_list)
		{
			peak_group[index++]=iter_peak;
		}
		
		return peak_group;
	}

}
